﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QLHH_HD
{
    class Hoadon
    {
        DALHoaDon dal = new DALHoaDon();
        public Hoadon()
        {

        }
        public DataTable DanhSachHoadon()
        {
            DataTable dt = dal.DocDanhSachHoadon();
            return dt;
        }
        public void XoaHoadon(String sohd)
        {
            dal.XoaHoaDon(sohd);
        }
        public void ThemHoaDon(string sohoadon, string mahang, int soluong, double dongia,double trigia, double khuyenmai, string diengiai)
         {
            double trigia = soluong * dongia;
            double khuyenmai = 0.0;
            if (trigia > 20000000)
                khuyenmai = (trigia * 5) / 100;
            else
                khuyenmai = 0.0;
            dal.ThemHoaDon(sohoadon, mahang, soluong, dongia, trigia, khuyenmai, diengiai);
        }
    }
    }
}